#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
PostgreSQL管理工具配置文件
包含常量、默认配置和路径定义
"""

import platform
import os

# 默认参数
DEFAULT_PORT = 5432
DEFAULT_PGPOOL_PORT = 9999
DEFAULT_PCP_PORT = 9898
DEFAULT_REPLICATION_USER = "replicator"
DEFAULT_REPLICATION_PASSWORD = None  # 应通过用户输入获取，而非硬编码
DEFAULT_REPMGR_USER = "repmgr"
DEFAULT_REPMGR_DATABASE = "repmgr"
DEFAULT_APPLICATION_NAME = "service1"  # 复制连接的应用名称

# 文件路径
REPMGR_CONFIG_PATH = "/usr/local/pgsql/repmgr.conf"
PGPASS_FILE = "~/.pgpass"
PCP_PASS_FILE = "~/.pcppass"

# 命令超时设置(秒)
COMMAND_TIMEOUT = 60

# 临时文件目录
TEMP_DIR = "/tmp" if not platform.system() == "Windows" else os.environ.get("TEMP", "C:\\Windows\\Temp")

# 版本信息
VERSION = "3.0.0" 